<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of MY_Controller
 *
 * @author Administrator
 */
class Base_Controller extends CI_Controller {

    public $data;
    public $httpcode = [
        'errno' => 200,
        'error' => '连接成功'
    ];

    public function __construct() {
        parent::__construct();
        $this->load->model('common_model');
        $this->data['tid'] = 0;
        
        $query = $this->db->select('*')->get('qbjh_webconfig');
        $webconfig = $query->result_array();
        $webinfo = [];
        foreach($webconfig as $k=>$rows){
            $webinfo[$rows['en_name']] = $rows;
        }
        $this->data['webinfo'] = $webinfo;
    }

    public function getPlaner($tid) {
        $planer = [];
        switch ($tid) {
            case 1: {
                    $planer = ['千变', '妹子', '转运', '发财', '宇治', '三丰'];
                }break;
            case 2: {
                    $planer = ['晴天', '子俊', '无双', '嗨氏', '橙光', '牛顿'];
                }break;
            case 3: {
                    $planer = ['马云', '收米'];
                }break;
            case 4: {
                    $planer = ['木兰', '梵高'];
                }break;
            case 5: {
                    $planer = ['吉祥', '讯飞'];
                }break;
        }
        return $planer;
    }
    public function getLimit($tid){
        if($tid==1||$tid==2){
            $limit = 6;
        } else {
            $limit = 2;
        }
        return $limit;
    }

}
